package demo;

import com.mchange.v2.c3p0.ComboPooledDataSource;
import javax.sql.DataSource;
/**
 * Util
 * 数据库连接池和dbutils
 */
public class JDBCUtil {

    static ComboPooledDataSource dataSource;
    //初始化数据库连接池
    static {
        dataSource = new ComboPooledDataSource();
    }

    //获取数据库连接池
    public static DataSource getDataSource(){

        return dataSource;
    }

    //获取数据库连接
//    public static Connection getConn() throws SQLException {
//        //获取数据库连接池
//        ComboPooledDataSource dataSource = new ComboPooledDataSource();
//        //获取数据库连接对象
//        Connection conn = dataSource.getConnection();
//        return null;
//    }
}
